﻿using Aspose.Pdf;
using System;
using System.Collections.Generic;
using System.Text;

namespace FileConvert.AsposeOper
{
    public class EPubFile
    {
        public EPubFile(string fromFile, string toFile)
        {
            _formFile = fromFile;
            _toFile = toFile;
            AsposeRegister.Register_Pdf();
        }
        ~EPubFile()
        {
            // doc.Dispose();
        }
        Aspose.Pdf.Document doc;
        private string _formFile = "";
        private string _toFile = "";
        public void ConvertToPdf()
        {
            EpubLoadOptions options = new EpubLoadOptions();
            doc = new Aspose.Pdf.Document(_formFile, options);
            doc.Save(_toFile,Aspose.Pdf.SaveFormat.Pdf);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public void ConvertToXPS()
        {
            EpubLoadOptions options = new EpubLoadOptions();
            doc = new Aspose.Pdf.Document(_formFile, options);
            doc.Save(_toFile, Aspose.Pdf.SaveFormat.Xps);
        }


        public void ConvertToHTML()
        {
            EpubLoadOptions options = new EpubLoadOptions();
            doc = new Aspose.Pdf.Document(_formFile, options);
            doc.Save(_toFile, SaveFormat.Html);
        }

        //public void ConvertToEPub()
        //{
        //    doc = new Aspose.Words.Document(_formFile);
        //    doc.Save(_toFile, SaveFormat.Epub);
        //}
    }
}
